package com.zrf.geekbang.spring.bean;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author zhouruifeng
 * @date 2020-06-21
 */
public class BeanInstantiationDemo {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/META-INF/bean-instantiation-context.xml");
        Object staticMethodUser = applicationContext.getBean("staticMethodUser");
        System.out.println(staticMethodUser);

        Object instanceMethodUser = applicationContext.getBean("instanceMethodUser");
        System.out.println(instanceMethodUser);

        Object userFactoryBean = applicationContext.getBean("userFactoryBean");
        System.out.println(userFactoryBean);
    }
}
